package com.fessc.develop.entity.ccbvo;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fessc.develop.model.enums.EnumResultType;
import com.fessc.develop.utils.BusiUtil;
import com.fessc.develop.utils.DateUtil;
import lombok.Data;

@Data
@JsonInclude(value = JsonInclude.Include.NON_NULL)
public class CCBResponseHeadVo {

    @JsonProperty("MsgBsnTp")
    String msgbsntp;  //业务类型

    @JsonProperty("CoPlfID")
    String coplfid;   //交易平台码

    @JsonProperty("Org")
    String org;   //机构代码

    @JsonProperty("ResTime")
    String restime;   //返回时间

    @JsonProperty("RstCode")
    String rstcode;   //返回码00:成功  01:失败

    @JsonProperty("RstDsc")
    String rstdsc;   //返回信息

    @JsonProperty("ReqTraceId")
    String reqtraceid;   //发送方流水号

    @JsonProperty("ResTraceId")
    String restraceid;   //接收方流水号

    public CCBResponseHeadVo() {
        String serialNumber = BusiUtil.getSerialNumber("", "", 8);
        this.restraceid = serialNumber;
        this.reqtraceid = serialNumber;
        this.restime = DateUtil.getCurrentDateTime(DateUtil.DATE_TIME_FORMAT);
        this.rstcode = "00";
    }

    public CCBResponseHeadVo(String rstcode, String rstdsc) {
        String serialNumber = BusiUtil.getSerialNumber("", "", 8);
        this.restime = DateUtil.getCurrentDateTime(DateUtil.DATE_TIME_FORMAT);
        this.rstcode = BusiUtil.nvl(rstcode, EnumResultType.CCB_SUCCESS.getStatusCode());
        this.rstdsc = BusiUtil.nvl(rstdsc, "");
        this.restraceid = serialNumber;
        this.reqtraceid = serialNumber;
    }


}
